package com.zhang.graph.directedgraph;

/**
 * @author zhang
 * @time 2022/02/26 08:31:21
 */
public class Test {
    public static void main(String[] args) {
        Graph g = new Graph();
        g.addNode("A");
        g.addNode("B");
        g.addNode("C");
        g.addNode("D");
//        g.addNode("E");


        g.addEdage("A","B");
//        g.addEdage("A","E");
        g.addEdage("A","C");
//        g.addEdage("B","D");
//        g.addEdage("D","B");
        g.addEdage("C","D");
//        g.addEdage("D","C");
        g.addEdage("B","D");


        System.out.println(g.topologicalSort());


    }
}
